/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ProductoCruz;

/**
 *
 * @author jc
 */
import javax.swing.*;
public class ProductoX {
    public static void main(String[] args) {
        
        int A[],B[];
        int i, tam, N, PEscalar = 0;
        tam = Integer.parseInt(JOptionPane.showInputDialog(null,"Ingrese tamaño de vectores"));
        A = new int[tam];
        B = new int[tam];
        for (i =0; i<tam;i++) {
            A[i] = Integer.parseInt(JOptionPane.showInputDialog("Ingrese dato vector en la posicion A["+i+"]"));
         }
       for (i =0; i<tam;i++) {
            B[i] = Integer.parseInt(JOptionPane.showInputDialog("Ingrese dato vector en la posicion B["+i+"]"));
         }
       for (i =0; i<tam;i++) {
            PEscalar = PEscalar + (A[i]*B[i]);
         }
       JOptionPane.showMessageDialog(null,"El producto escalar es: " + PEscalar );
    }
}
